package com.kantboot.tool.area.domain.entity;

import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import java.io.Serializable;

@Entity
@Getter
@Setter
@Table(name = "tool_ad_area")
@Accessors(chain = true)
@EntityListeners(AuditingEntityListener.class)
@DynamicUpdate
@DynamicInsert
public class ToolAdArea implements Serializable {

    /**
     * 主键
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long id;

    /**
     * 国家区域编码
     */
    @Column(name = "state_area_code", length = 64)
    private String stateAreaCode;

    @Column(name = "ad_code", length = 64)
    private String adCode;

    @Column(name = "ad_level")
    private Integer adLevel;

    @Column(name = "ad_level_1_ad_code", length = 64)
    private String adLevel1AdCode;

    @Column(name = "ad_level_2_ad_code", length = 64)
    private String adLevel2AdCode;

    @Column(name = "ad_level_3_ad_code", length = 64)
    private String adLevel3AdCode;

    @Column(name = "t_name", length = 65535)
    private String name;

    @Column(name = "parent_ad_code", length = 64)
    private String parentAdCode;

}
